﻿using System.Windows.Input;
using CrateMayhem.Common.Commanding;
using CrateMayhem.Common.Services;

namespace CrateMayhem.Common.ViewModel
{
    public class OptionsViewModel : ViewModelBase
    {
        private readonly IGameSettingsService gameSettingsService;

        public OptionsViewModel(IServiceFactory serviceFactory)
        {
            gameSettingsService = serviceFactory.Create<IGameSettingsService>();
            SwitchControlsCommand = new DelegateCommand(SwitchControls);
            ResetLevelsCommand = new DelegateCommand(ResetLevel);
        }

        public ICommand SwitchControlsCommand { get; private set; }
        public ICommand ResetLevelsCommand { get; private set; }

        public void SwitchControls()
        {
            gameSettingsService.SwitchControls();
        }

        public void ResetLevel()
        {
            gameSettingsService.ResetLevels();
        }
    }
}